package pattern9;

/**
 * p112
 * 建造者模式
 * @author wdl
 */
public class BuilderPattern {
    public static void main(String[] args) {
        Director director=new Director();
        Builder builder1=new ConcreteBuilder1();
        Builder builder2=new ConcreteBuilder2();

        //指挥者构建产品
        director.buildProduct(builder1);
        Product product1=builder1.getResult();
        product1.show();

        director.buildProduct(builder2);
        Product product2=builder2.getResult();
        product2.show();
    }
}
